// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright (c) 2023 Yevhen Babiichuk (DustDFG)

#ifndef _DOT_SORT_VIEW_ISFMLTUBE_HPP_
#define _DOT_SORT_VIEW_ISFMLTUBE_HPP_

#include <cstdint>

#include <SFML/Graphics/Texture.hpp>
#include <SFML/Graphics/Rect.hpp>

#include <DotSort/View/ITube.hpp>

namespace View
{

class ISFMLTube : public ITube
{
	protected:
		ISFMLTube(uint8_t size, sf::FloatRect boundsRect);

		sf::FloatRect boundsRect;

		// Implementation independent way to set texture to slot
		// Zero value of slotIndex is bottom of the tube
		virtual void fillSlot(uint8_t slotIndex, sf::Texture* texture, sf::IntRect textureRect) = 0;

		sf::FloatRect getSlotRect(uint8_t slotIndex) const;
		sf::FloatRect getOverflowRect() const;

	public:
		virtual ~ISFMLTube() = default;

		bool contains(sf::Vector2f position);
};

}

#endif
